package com.clwl.supervise.superviseapp.controller.base;


import com.clwl.supervise.superviseapp.entity.base.JgMessage;
import com.clwl.supervise.superviseapp.entity.result.ResultEntity;
import com.clwl.supervise.superviseapp.service.base.SysNoticeService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/sysNotice")
public class SysNoticeController {


    @Resource
    private SysNoticeService sysNoticeService;

    @GetMapping("list")
    public ResultEntity<List<JgMessage>> messagePage(@RequestParam(required = true) Integer pageNum, @RequestParam(required = true) Integer pageSize){
        List<JgMessage> dataList= sysNoticeService.selectMessageList(pageNum,pageSize);
        return ResultEntity.success(dataList);
    }
    @GetMapping("info")
    public ResultEntity<JgMessage> info( Long id){
        JgMessage data= sysNoticeService.selectMessageInfo(id);
        return ResultEntity.success(data);
    }


}
